class Person < ActiveRecord::Base
    validates_presence_of :user, :surname, :firstname
    #validates_numericality_of :age, :class_standing, :major
    #errors.add(:age, "Not a valid age") if age.nil? || age < 0
    #errors.add(:gender, "Not a valid gender") if gender.nil? || !(gender == "male" || gender == "female")
    
    #belongs_to :grade_entry
    #has_one :contact
    #has_one :major
    #has_one :class_standing
    
    protected
    	def self.find_all_persons
    		find(:all, :order => "firstname")
    	end
    	
    	def self.find_by_username(username)
    	    find(:first, :conditions => [ "user = ?", username])
    	end
    
end
